﻿--Correction de la procedure [medianamik_GetCurrentParentTypes] pour ne pas tenir compte des noeuds supprimés

ALTER PROCEDURE [dbo].[medianamik_GetCurrentParentTypes] 
	-- Add the parameters for the stored procedure here
	@TypeId uniqueidentifier
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	SELECT NodeType.* FROM medianamik_Node AS Node
	INNER JOIN medianamik_Type AS NodeType ON NodeType.TypeId = Node.TypeID
	WHERE Node.IsDeleted = 0
	AND NodeId IN
		(SELECT ParentNodeId FROM medianamik_Node
		WHERE TypeId = @TypeId)
END